#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: relations_clone.py 
@version:
@time: 2022/05/31 
"""


class RelationSync:
    def __init__(self, kwargs):
        self.joinKeys = kwargs.get('joinKeys', [('pk', 'pk')])
        self.databaseType = kwargs.get('databaseType', '')
        self.joinType = kwargs.get('joinType', 'upsert')
        self.joinPath = kwargs.get('joinPath', '')
        self.manyOneUpsert = kwargs.get('manyOneUpsert', False)
        # joinKeys: [(key, key)]
        self.arrayUniqueKey = kwargs.get('arrayUniqueKey', '')
        self.isArray = kwargs.get('isArray', False)
        self.associationType = kwargs.get('associationType', '')
        if not self.joinKeys:
            raise 'Relation no join key'
        if kwargs.get('redisKeyPrefix', False):
            self.redisKeyPrefix = kwargs.get('redisKeyPrefix')
